package com.li.youhappygo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.li.youhappygo.model.entity.order.OrderItem;
import com.li.youhappygo.model.entity.product.ProductSku;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Mapper
public interface OrderItemMapper extends BaseMapper<OrderItem> {

    @Select("SELECT ps.* FROM order_item oi JOIN product_sku ps ON  oi.sku_id = ps.sku_id WHERE oi.order_id = #{orderId}")
    List<ProductSku> findProductSkuList(Long orderId);
}
